﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LstProducts.ascx.cs" Inherits="Web.Cms.Products.LstProducts" %>
<script type="text/javascript">
    $(document).ready(function () {
        $("#<%=txtKeysearch.ClientID%>").autocomplete('/Layout/AutoComplateSearch/SearchTenCasi.ashx');
    });       
</script>
<script type="text/javascript">
    $(function () {
        $("#<%=txtDatefrom.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/images/calendar_1.gif', buttonImageOnly: true });
        $("#<%=txtDateTo.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/images/calendar_1.gif', buttonImageOnly: true });
    });
</script>
<%@ Register TagPrefix="uc1" TagName="PagingAjax" Src="~/Cms/AjaxCP/Paging.ascx" %>
<style type="text/css">
    .style1
    {
        text-align: right;
    }
    .style2
    {
        text-align: center;
    }
</style>

<div style="padding-bottom: 20px;" class="fl">
    <p class="heading" style="margin-left:400px; "> DANH SÁCH SẢN PHẨM</p>          
</div>
<br />
<div style="clear:both;"><asp:Label Font-Bold="true" ForeColor="red" Font-Size="11px" ID="lblMessage" runat="server"></asp:Label></div>

<table width="800px" align="center" style="margin-left:250px">
    <tr>
        <td class="style1">
            <strong>Nhập tên sản&nbsp; phẩm:</strong></td>
        <td>
            <asp:TextBox ID="txtKeysearch" runat="server" Height="20px"></asp:TextBox>
        </td>
        <%--<td class="style1">
            <strong>Một số lựa chọn:</strong></td>
        <td>
            <asp:DropDownList ID="dropCheckType" runat="server" Height="20px">
                <asp:ListItem Value="0">--Lựa chọn--</asp:ListItem>
                <asp:ListItem Value="1">Sản phẩm nổi bật</asp:ListItem>
                <asp:ListItem Value="2">Sản phẩm hot nhất</asp:ListItem>
                <asp:ListItem Value="3">Sản phẩm mới nhất</asp:ListItem>
            </asp:DropDownList>
        </td>--%>
        <td>
            <strong>Chuyên mục:</strong></td>
        <td>
            <asp:DropDownList ID="dropZoneId" runat="server" Height="20px">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            <strong>Từ ngày(yy/mm/dd):</strong></td>
        <td>
            <asp:TextBox ID="txtDatefrom" runat="server" Height="20px"></asp:TextBox>
            </td>
        <td class="style1">
            <strong>Đến ngày:</strong></td>
        <td>
            <asp:TextBox ID="txtDateTo" runat="server" Height="20px"></asp:TextBox>
            </td>
        <td>
            <asp:Button runat="server" ID="btnTimKiem" CssClass="Button_Search" 
                onclick="btnTimKiem_Click"/></td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
</table>

<br />

<asp:GridView ID="grdProduct" runat="server" SkinID="AdminGridView" 
    BackColor="White" AutoGenerateColumns="False" 
    onrowcommand="grdProduct_RowCommand" 
    onrowdatabound="grdProduct_RowDataBound">
    <Columns>               
         <asp:BoundField HeaderText="STT">
            <ItemStyle HorizontalAlign="Center" Width="20px" />
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle />
        </asp:BoundField>         
        <asp:BoundField HeaderText="Tên sản phẩm" DataField="ProductName">            
        </asp:BoundField>                   
        <asp:BoundField HeaderText="Ngày tạo" DataField="CreatedOn" HeaderStyle-Width="130">
            <ItemStyle HorizontalAlign="Center" />
            <HeaderStyle HorizontalAlign="center" />            
        </asp:BoundField>   
         <asp:TemplateField HeaderText="Người tạo">
            <ItemStyle HorizontalAlign="Center" />           
           <ItemTemplate><%#Eval("CreatedBy")%> </ItemTemplate>
         </asp:TemplateField>
        <asp:TemplateField HeaderText="Ảnh" HeaderStyle-Width="100">
            <ItemTemplate>
                <asp:ImageButton runat="server" ID="img" Visible="false" Width="75" Height="50" />
            </ItemTemplate>

        <HeaderStyle Width="100px"></HeaderStyle>
        </asp:TemplateField>        
        <asp:TemplateField HeaderText="Sửa" HeaderStyle-Width="20">
            <ItemTemplate>                                                
                <a style="cursor:hand;" href="../cms/Default.aspx?ctrlkey=CreateEditProducts&productId=<%# Eval("ProductId") %>"><img src="../App_Themes/Default/Images/edit.gif" border="0"></a>
            </ItemTemplate>

<HeaderStyle Width="20px"></HeaderStyle>
        </asp:TemplateField>

          <asp:TemplateField HeaderStyle-Width="30" HeaderText="Status">
            <ItemTemplate>                             
                <asp:ImageButton ID="btnStatus" runat="server" CommandArgument='<%# Eval("ProductId") %>' CommandName="CommandStatus" />   
            </ItemTemplate>
            </asp:TemplateField>
            
        <asp:TemplateField HeaderText="Xóa" HeaderStyle-Width="20">
            <ItemTemplate>             
                <asp:Button ID="btnDelete" runat="server" CssClass="Icon_Delete" CommandArgument='<%# Eval("ProductId") %>' CommandName="Commanddelete" OnClientClick="return confirm('Bạn có chắc chắn xóa không ?')" />                   
            </ItemTemplate>

<HeaderStyle Width="20px"></HeaderStyle>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<p style="text-align:center;">
 <br />            
    <asp:Label runat="server" ID="lbTotal" Font-Bold="true" Font-Size="15px" ForeColor="red"></asp:Label>            
    <br />  <br />
    </p>
<table cellspacing="0" cellpadding="0" border="0" width="100%">       
    <tr>
        <td colspan="4" align="center" style="height: 21px">
            <br />            
            <uc1:PagingAjax ID="PagingAjax1" runat="server" />            
            <br />
        </td>
    </tr>
</table>